Skip to content

test(e2e): add indexing and gRPC query e2e tests#52

Merged
pthmas merged 3 commits intomainfrom
pthmas/tastora-integration-tests
Apr 28, 2026
Merged

test(e2e): add indexing and gRPC query e2e tests#52
pthmas merged 3 commits intomainfrom
pthmas/tastora-integration-tests

Conversation

@pthmas
Copy link
Copy Markdown
Collaborator

@pthmas pthmas commented Apr 28, 2026

Summary

Adds two new e2e tests using the existing Tastora setup: TestIndexingQueryPaths covers the JSON-RPC blob.Get, blob.GetAll, header.GetByHeight, and header.LocalHead endpoints; TestGRPCBlobQuery exercises the same read paths via the gRPC BlobService and HeaderService. Also renames the CI e2e-submission job to e2e and runs all ./... so new tests are picked up automatically.

Summary by CodeRabbit

  • Tests

    • Added Docker-backed end-to-end tests validating blob submission, indexing, and gRPC/header query paths.
  • CI

    • Renamed and rekeyed the end-to-end CI job to run the broader e2e test set (previously more narrowly filtered).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@pthmas pthmas self-assigned this Apr 28, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

Warning

Rate limit exceeded

@pthmas has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 33 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 818959b4-47a9-491a-a85c-788d14728a7d

📥 Commits

Reviewing files that changed from the base of the PR and between ad33b0e and dcf1fa0.

📒 Files selected for processing (1)
  • justfile
📝 Walkthrough

Walkthrough

CI workflow's e2e job renamed from e2e-submission to e2e and its test invocation broadened to run all e2e tests. Two new Docker-backed end-to-end tests were added: TestGRPCBlobQuery (gRPC blob/header endpoints) and TestIndexingQueryPaths (REST blob/header query paths).

Changes

Cohort / File(s) Summary
CI Workflow Configuration
.github/workflows/ci.yml
Renamed the end-to-end job from e2e-submission to e2e and changed the Go test command to run the broader ./... e2e test set instead of filtering to TestSubmissionViaJSONRPC.
New E2E Test Suites
e2e/grpc_test.go, e2e/indexing_test.go
Added two Docker-backed end-to-end tests: TestGRPCBlobQuery exercises gRPC BlobService and HeaderService endpoints (insecure gRPC connection) and TestIndexingQueryPaths exercises REST API blob/header query paths. Both submit a blob, wait for indexing, and validate responses.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped through CI, with tests in my pack,
I nudged gRPC and REST down the rabbit-tracked stack,
Blobs and headers I chased with a cheer,
Indexed and fetched — the endpoints appear! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the main change: adding two new end-to-end tests (TestIndexingQueryPaths and TestGRPCBlobQuery) for indexing and gRPC query functionality.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pthmas/tastora-integration-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
e2e/grpc_test.go (1)

81-161: Table-drive the gRPC endpoint checks to reduce duplication.

The subtests are valid; converting them to table-driven cases would better match project test conventions and make future endpoint additions easier.

As per coding guidelines, "Use table-driven tests in Go test files".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@e2e/grpc_test.go` around lines 81 - 161, Convert the repeated subtests into a
single table-driven test: define a slice of test cases (with fields name, call
type or a function closure, request payload, and a verify function) and iterate
with t.Run for each case; replace the separate invocations of
blobClient.GetByCommitment, blobClient.Get, blobClient.GetAll,
headerClient.GetByHeight, and headerClient.LocalHead by entries in that table,
using the existing variables (data, commitment, height, namespace) in the
request/verification closures; ensure each case's verify closure checks the same
conditions now duplicated (nil checks, data/commitment equality, blob inclusion,
header height comparisons) and call t.Fatalf/t.Fatal within the closure on
failure so behavior remains identical.
e2e/indexing_test.go (1)

69-128: Consider table-driving the RPC path assertions.

These subtests are clear, but a table-driven structure would remove repetition and match repository test conventions.

♻️ Refactor sketch
+type rpcCase struct {
+	name   string
+	method string
+	params []any
+	assert func(t *testing.T, r jsonRPCResponse)
+}
+
+cases := []rpcCase{
+	// blob.Get, blob.GetAll, header.GetByHeight, header.LocalHead
+}
+
+for _, tc := range cases {
+	tc := tc
+	t.Run(tc.name, func(t *testing.T) {
+		r := doRPC(t, proc, apexRPCAddr, tc.method, tc.params...)
+		if r.Error != nil {
+			t.Fatalf("%s error: %s", tc.name, r.Error.Message)
+		}
+		tc.assert(t, r)
+	})
+}
As per coding guidelines, "Use table-driven tests pattern for test cases".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@e2e/indexing_test.go` around lines 69 - 128, The subtests under Test (calls
to doRPC with RPC methods
"blob.Get","blob.GetAll","header.GetByHeight","header.LocalHead" and assertions
on rpcBlob/results) repeat similar logic; convert them to a table-driven test by
creating a slice of test cases (each with name, method string, params, and a
small checker function or expected condition) and iterate with for _, tc :=
range cases { t.Run(tc.name, func(t *testing.T) { r := doRPC(..., tc.method,
tc.params...); if r.Error != nil { t.Fatalf(...) }; tc.check(t, r) }) }.
Reference the existing helpers and types (doRPC, rpcBlob, commitment, data) when
implementing each case’s checker to preserve current assertions (blob
content/commitment checks, non-null header checks, blob list contains
commitment).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@e2e/grpc_test.go`:
- Around line 19-21: The test currently reuses the startup timeout context (ctx,
cancel) for all gRPC calls which can cause unrelated deadline errors; update
each gRPC request in this test (including calls between lines ~81-161) to create
and use a dedicated per-call context via newRPCCtx(), e.g. replace usages of ctx
with ctx := newRPCCtx() and defer cancel() immediately after each call's context
creation so every gRPC assertion has its own timeout and is not impacted by the
shared startup context.

---

Nitpick comments:
In `@e2e/grpc_test.go`:
- Around line 81-161: Convert the repeated subtests into a single table-driven
test: define a slice of test cases (with fields name, call type or a function
closure, request payload, and a verify function) and iterate with t.Run for each
case; replace the separate invocations of blobClient.GetByCommitment,
blobClient.Get, blobClient.GetAll, headerClient.GetByHeight, and
headerClient.LocalHead by entries in that table, using the existing variables
(data, commitment, height, namespace) in the request/verification closures;
ensure each case's verify closure checks the same conditions now duplicated (nil
checks, data/commitment equality, blob inclusion, header height comparisons) and
call t.Fatalf/t.Fatal within the closure on failure so behavior remains
identical.

In `@e2e/indexing_test.go`:
- Around line 69-128: The subtests under Test (calls to doRPC with RPC methods
"blob.Get","blob.GetAll","header.GetByHeight","header.LocalHead" and assertions
on rpcBlob/results) repeat similar logic; convert them to a table-driven test by
creating a slice of test cases (each with name, method string, params, and a
small checker function or expected condition) and iterate with for _, tc :=
range cases { t.Run(tc.name, func(t *testing.T) { r := doRPC(..., tc.method,
tc.params...); if r.Error != nil { t.Fatalf(...) }; tc.check(t, r) }) }.
Reference the existing helpers and types (doRPC, rpcBlob, commitment, data) when
implementing each case’s checker to preserve current assertions (blob
content/commitment checks, non-null header checks, blob list contains
commitment).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: de7be17e-188f-49c5-8bec-299344afbe4c

📥 Commits

Reviewing files that changed from the base of the PR and between dcb57f6 and 956ba67.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • e2e/grpc_test.go
  • e2e/indexing_test.go

Comment thread e2e/grpc_test.go Outdated
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
e2e/grpc_test.go (1)

87-177: Refactor repeated subtests into a table-driven structure.

The five gRPC assertions duplicate setup/timeout scaffolding; a table-driven loop would reduce repetition and make future endpoint additions easier to maintain.

♻️ Suggested refactor shape
+testCases := []struct {
+	name string
+	run  func(t *testing.T, rpcCtx context.Context)
+}{
+	{name: "BlobService.GetByCommitment", run: func(t *testing.T, rpcCtx context.Context) { /* existing assertions */ }},
+	{name: "BlobService.Get", run: func(t *testing.T, rpcCtx context.Context) { /* existing assertions */ }},
+	{name: "BlobService.GetAll", run: func(t *testing.T, rpcCtx context.Context) { /* existing assertions */ }},
+	{name: "HeaderService.GetByHeight", run: func(t *testing.T, rpcCtx context.Context) { /* existing assertions */ }},
+	{name: "HeaderService.LocalHead", run: func(t *testing.T, rpcCtx context.Context) { /* existing assertions */ }},
+}
+
+for _, tc := range testCases {
+	tc := tc
+	t.Run(tc.name, func(t *testing.T) {
+		rpcCtx, cancel := newRPCCtx(t)
+		defer cancel()
+		tc.run(t, rpcCtx)
+	})
+}

As per coding guidelines, "Use table-driven tests pattern for test cases".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@e2e/grpc_test.go` around lines 87 - 177, The five nearly-identical t.Run
blocks should be refactored into a single table-driven test: create a slice of
test cases (with fields like name, request, clientMethod identifier e.g.
blobClient.GetByCommitment, blobClient.Get, blobClient.GetAll,
headerClient.GetByHeight, headerClient.LocalHead, and expected-check type), then
loop over them calling t.Run(tc.name, func(t *testing.T){ rpcCtx, cancel :=
newRPCCtx(t); defer cancel(); resp, err := tc.clientMethod(rpcCtx, tc.request);
handle err and perform the appropriate assertions based on tc.expected-check
(non-nil blob/header, data/commitment equality, presence in GetAll, height
checks) so setup/teardown and timeouts are shared and new endpoints can be added
by appending to the table.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@e2e/grpc_test.go`:
- Around line 87-177: The five nearly-identical t.Run blocks should be
refactored into a single table-driven test: create a slice of test cases (with
fields like name, request, clientMethod identifier e.g.
blobClient.GetByCommitment, blobClient.Get, blobClient.GetAll,
headerClient.GetByHeight, headerClient.LocalHead, and expected-check type), then
loop over them calling t.Run(tc.name, func(t *testing.T){ rpcCtx, cancel :=
newRPCCtx(t); defer cancel(); resp, err := tc.clientMethod(rpcCtx, tc.request);
handle err and perform the appropriate assertions based on tc.expected-check
(non-nil blob/header, data/commitment equality, presence in GetAll, height
checks) so setup/teardown and timeouts are shared and new endpoints can be added
by appending to the table.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6b7f9bbc-6af2-4296-a914-5519b618cf15

📥 Commits

Reviewing files that changed from the base of the PR and between 956ba67 and ad33b0e.

📒 Files selected for processing (1)
  • e2e/grpc_test.go

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@pthmas pthmas merged commit 4bbc118 into main Apr 28, 2026
5 checks passed
@pthmas pthmas deleted the pthmas/tastora-integration-tests branch April 28, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant